home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 1
/
Gekikoh Dennoh Club Vol. 1 (Japan).7z
/
Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin
/
kowin
/
archive
/
kob
/
kob001s.lzh
/
kofunc.has
< prev
next >
Wrap
Text File
|
1997-03-08
|
27KB
|
1,535 lines
*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
*
* kofunc.has …… こ-BASICの標準関数
*
*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
.include fdef.h
.include iocscall.mac
.include variable.h
.include kob.h
.xref hash
.xref func参照sysvar
.text
.even
.xdef kofunc_init
kofunc_init:
move.w d5,-(sp)
lea.l ptr_token(pc),a5
lea.l ptr_param(pc),a0
lea.l ptr_exec(pc),a1
moveq #0,d3
kofunc_init_loop:
bsr hash
* a2.l = 元の対象の開始アドレス
* d4.l = (hash.w)(文字数 - 1)
move.l d4,(a4)+ * (hash.w)(文字数 - 1)
move.l a2,(a4)+ * 名前
move.w (a0,d3.w),d0
lea.l (a0,d0.w),a2
move.l a2,(a4)+ * パラメータリストを指すポインタ
move.w (a1,d3.w),d0
lea.l (a1,d0.w),a2
move.l a2,(a4)+ * 実行アドレス
addq.w #1,d6
addq.w #2,d3
addq.l #1,a5 * $00
tst.b (a5)
bne kofunc_init_loop
* こ-標準関数の初期化処理
*move.w #-1,strtok_work
move.w (sp)+,d5
rts
ptr_token:
.dc.b 'WindowOpen',0
.dc.b 'WindowSimpleOpen',0
.dc.b 'WindowTitleOpen',0
.dc.b 'WindowScrollOpen',0
.dc.b 'WindowClose',0
.dc.b 'WindowPop',0
.dc.b 'WindowPush',0
.dc.b 'WindowRedraw',0
.dc.b 'WindowMove',0
.dc.b 'WindowResize',0
.dc.b 'WindowMoveOperation',0
.dc.b 'WindowResizeOperation',0
.dc.b 'WindowGetPosition',0
.dc.b 'WindowGetSize',0
.dc.b 'WindowLoadExec',0
.dc.b 'UserSendExec',0
.dc.b 'PopUpMenu',0
.dc.b 'IconEnt',0
.dc.b 'SendUserString',0
.dc.b 'SendUserSheet',0
.dc.b 'SendUserGraphic',0
.dc.b 'GetUserString',0
.dc.b 'GetUserSheet',0
.dc.b 'GetUserGraphic',0
.dc.b 'DrawClear',0
.dc.b 'DrawLine',0
.dc.b 'DrawBox',0
.dc.b 'DrawFill',0
.dc.b 'DrawShadow',0
.dc.b 'DrawPut',0
.dc.b 'DrawSymbol',0
.dc.b 'GraphicInit',0
.dc.b 'DrawGraphicClear',0
.dc.b 'DrawGraphicLine',0
.dc.b 'DrawGraphicBox',0
.dc.b 'DrawGraphicFill',0
.dc.b 'DrawGraphicShadow',0
.dc.b 'DrawGraphicPut',0
.dc.b 'TrumpOpen',0
.dc.b 'JpaiOpen',0
.dc.b 'TrumpClose',0
.dc.b 'JpaiClose',0
.dc.b 'DrawCard',0
.dc.b 'DrawMonoCard',0
.dc.b 'IntervalTime',0
.dc.b 0
.even
ptr_param:
pp:
.dc.w p_WindowOpen-pp
.dc.w p_WindowSimpleOpen-pp
.dc.w p_WindowTitleOpen-pp
.dc.w p_WindowScrollOpen-pp
.dc.w p_WindowClose-pp
.dc.w p_WindowPop-pp
.dc.w p_WindowPush-pp
.dc.w p_WindowRedraw-pp
.dc.w p_WindowMove-pp
.dc.w p_WindowResize-pp
.dc.w p_WindowMoveOperation-pp
.dc.w p_WindowResizeOperation-pp
.dc.w p_WindowGetPosition-pp
.dc.w p_WindowGetSize-pp
.dc.w p_WindowLoadExec-pp
.dc.w p_UserSendExec-pp
.dc.w p_PopUpMenu-pp
.dc.w p_IconEnt-pp
.dc.w p_SendUserString-pp
.dc.w p_SendUserSheet-pp
.dc.w p_SendUserGraphic-pp
.dc.w p_GetUserString-pp
.dc.w p_GetUserSheet-pp
.dc.w p_GetUserGraphic-pp
.dc.w p_DrawClear-pp
.dc.w p_DrawLine-pp
.dc.w p_DrawBox-pp
.dc.w p_DrawFill-pp
.dc.w p_DrawShadow-pp
.dc.w p_DrawPut-pp
.dc.w p_DrawSymbol-pp
.dc.w p_GraphicInit-pp
.dc.w p_DrawGraphicClear-pp
.dc.w p_DrawGraphicLine-pp
.dc.w p_DrawGraphicBox-pp
.dc.w p_DrawGraphicFill-pp
.dc.w p_DrawGraphicShadow-pp
.dc.w p_DrawGraphicPut-pp
.dc.w p_TrumpOpen-pp
.dc.w p_JpaiOpen-pp
.dc.w p_TrumpClose-pp
.dc.w p_JpaiClose-pp
.dc.w p_DrawCard-pp
.dc.w p_DrawMonoCard-pp
.dc.w p_IntervalTime-pp
ptr_exec:
pe:
.dc.w WindowOpen-pe
.dc.w WindowSimpleOpen-pe
.dc.w WindowTitleOpen-pe
.dc.w WindowScrollOpen-pe
.dc.w WindowClose-pe
.dc.w WindowPop-pe
.dc.w WindowPush-pe
.dc.w WindowRedraw-pe
.dc.w WindowMove-pe
.dc.w WindowResize-pe
.dc.w WindowMoveOperation-pe
.dc.w WindowResizeOperation-pe
.dc.w WindowGetPosition-pe
.dc.w WindowGetSize-pe
.dc.w WindowLoadExec-pe
.dc.w UserSendExec-pe
.dc.w PopUpMenu-pe
.dc.w IconEnt-pe
.dc.w SendUserString-pe
.dc.w SendUserSheet-pe
.dc.w SendUserGraphic-pe
.dc.w GetUserString-pe
.dc.w GetUserSheet-pe
.dc.w GetUserGraphic-pe
.dc.w DrawClear-pe
.dc.w DrawLine-pe
.dc.w DrawBox-pe
.dc.w DrawFill-pe
.dc.w DrawShadow-pe
.dc.w DrawPut-pe
.dc.w DrawSymbol-pe
.dc.w GraphicInit-pe
.dc.w DrawGraphicClear-pe
.dc.w DrawGraphicLine-pe
.dc.w DrawGraphicBox-pe
.dc.w DrawGraphicFill-pe
.dc.w DrawGraphicShadow-pe
.dc.w DrawGraphicPut-pe
.dc.w TrumpOpen-pe
.dc.w JpaiOpen-pe
.dc.w TrumpClose-pe
.dc.w JpaiClose-pe
.dc.w DrawCard-pe
.dc.w DrawMonoCard-pe
.dc.w IntervalTime-pe
*-------------------
p_WindowOpen:
p_WindowSimpleOpen:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_val * h
.dc.w int_val * v
.dc.w int_omt * ParentWindowNumber
.dc.w int_ret *** WindowNumber
p_WindowTitleOpen:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_val * h
.dc.w int_val * v
.dc.w int_omt * ParentWindowNumber
.dc.w str_val * label(WindowName)
.dc.w int_val * option
.dc.w int_ret *** WindowNumber
p_WindowScrollOpen:
.dc.w void_ret
p_WindowClose:
p_WindowPop:
p_WindowPush:
p_WindowRedraw:
.dc.w int_val * WindowNumber
.dc.w int_ret *** error code
p_WindowMove:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_ret *** error code
p_WindowResize:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_val * h
.dc.w int_val * v
.dc.w int_ret *** error code
p_WindowMoveOperation:
p_WindowResizeOperation:
.dc.w void_ret
p_WindowGetPosition:
p_WindowGetSize:
.dc.w int_val * WindowNumber
.dc.w int_vp * xp/hp
.dc.w int_vp * yp/vp
.dc.w int_ret *** error code
p_WindowLoadExec:
.dc.w str_val
.dc.w str_omt
.dc.w int_omt
.dc.w int_ret
p_UserSendExec:
.dc.w str_val
.dc.w str_omt
.dc.w str_omt
.dc.w int_ret
p_PopUpMenu:
.dc.w int_val * x
.dc.w int_val * y
.dc.w $0038 * item(ary1_s)
.dc.w int_omt * {items}
.dc.w int_omt * {font=12}
.dc.w int_ret
p_IconEnt:
.dc.w int_val * WindowNumber
.dc.w str_val * icon title
.dc.w int_omt * attribute of icon title
.dc.w int_omt * font size of icon title
.dc.w int_ret *** error code
p_SendUserString:
.dc.w str_val
.dc.w void_ret
p_SendUserSheet:
.dc.w int_val
.dc.w int_val
.dc.w ary1_c
.dc.w ary1_c
.dc.w void_ret
p_SendUserGraphic:
.dc.w int_val
.dc.w int_val
.dc.w $0036 * graph ( ary1_ic )
.dc.w void_ret
p_GetUserString:
.dc.w str_vp
.dc.w void_ret
p_GetUserSheet:
.dc.w int_vp
.dc.w int_vp
.dc.w ary1_c
.dc.w ary1_c
.dc.w void_ret
p_GetUserGraphic:
.dc.w int_vp
.dc.w int_vp
.dc.w $0036 * graph ( ary1_ic )
.dc.w void_ret
p_DrawSymbol:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w str_val * 表示文字列
.dc.w int_omt * 属性
.dc.w int_omt * font
.dc.w int_ret *** error code
p_DrawPut:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_val * x_size
.dc.w int_val * y_size
.dc.w ary1_c * sheet1
.dc.w ary1_c * sheet2
.dc.w void_ret
p_DrawLine:
p_DrawBox:
p_DrawFill:
p_DrawShadow:
.dc.w int_val * WindowNumber
.dc.w int_val * x1
.dc.w int_val * y1
.dc.w int_val * x2
.dc.w int_val * y2
.dc.w int_val * color
.dc.w int_ret *** error code
p_DrawClear:
.dc.w int_val * WindowNumber
.dc.w int_val * color
.dc.w int_ret *** error code
p_GraphicInit:
.dc.w int_val
.dc.w int_val
.dc.w $00b2 * 省略可能な int 配列
.dc.w void_ret
p_DrawGraphicClear:
.dc.w int_val
.dc.w int_val
.dc.w int_ret
p_DrawGraphicLine:
p_DrawGraphicBox:
p_DrawGraphicFill:
p_DrawGraphicShadow:
.dc.w int_val * WindowNumber
.dc.w int_val * x1
.dc.w int_val * y1
.dc.w int_val * x2
.dc.w int_val * y2
.dc.w int_val * color
.dc.w int_ret *** error code
p_DrawGraphicPut:
.dc.w int_val * WindowNumber
.dc.w int_val * x1
.dc.w int_val * y1
.dc.w int_val * x2
.dc.w int_val * y2
.dc.w $0036 * graph ( ary1_ic )
.dc.w int_omt * offset
.dc.w void_ret
p_TrumpOpen:
p_JpaiOpen:
p_TrumpClose:
p_JpaiClose:
.dc.w int_ret
p_DrawCard:
p_DrawMonoCard:
.dc.w int_val * WindowNumber
.dc.w int_val * x
.dc.w int_val * y
.dc.w int_val * card#
.dc.w int_val * card 種類
.dc.w int_ret *** error code
p_IntervalTime:
.dc.w int_ret
*-------------------
get_WindowID:
lea.l _bwp,a0
lsl.w #2,d0
move.l (a0,d0.w),d0
rts
open_sub:
lea.l _bwp,a0
tst.l d0 * WindowNumber
bmi wnum探す
cmpi.w #WINMAX,d0
bcc cant_open
move.w d0,d1
lsl.w #2,d1
tst.l (a0,d1.w)
beq @f
cant_open:
moveq #-1,d0 * 空きがない
@@:
rts
wnum探す:
moveq #WINMAX-1,d1
2:
tst.l (a0)+
dbeq d1,2b
bne cant_open
moveq #WINMAX-1,d0
sub.w d1,d0
rts
*-------------------
WindowOpen:
move.l par1+6(sp),d0 * WindowNumber
bsr open_sub
move.l d0,_WinNumber
bmi return_minus
pea.l _EventExec(pc) * event
pea.l 0.w * parentWindow ( ROOT )
move.l par5+6+08(sp),-(sp)
move.l par4+6+12(sp),-(sp)
move.l par3+6+16(sp),-(sp)
move.l par2+6+20(sp),-(sp)
bsr _WindowOpen
lea.l 4*6(sp),sp
bra Wopen共通
WindowSimpleOpen:
move.l par1+6(sp),d0 * WindowNumber
bsr open_sub
move.l d0,_WinNumber
bmi return_minus
pea.l _EventExec(pc) * event
pea.l 0.w * parentWindow ( ROOT )
move.l par5+6+08(sp),-(sp)
move.l par4+6+12(sp),-(sp)
move.l par3+6+16(sp),-(sp)
move.l par2+6+20(sp),-(sp)
bsr _WindowSimpleOpen
lea.l 4*6(sp),sp
bra Wopen共通
WindowTitleOpen:
move.l par1+6(sp),d0 * WindowNumber
bsr open_sub
move.l d0,_WinNumber
bmi return_minus
pea.l _EventExec(pc) * event
move.l par8+6+04(sp),-(sp)
move.l par7+6+08(sp),-(sp)
pea.l 0.w * parentWindow ( ROOT )
move.l par5+6+16(sp),-(sp)
move.l par4+6+20(sp),-(sp)
move.l par3+6+24(sp),-(sp)
move.l par2+6+28(sp),-(sp)
bsr _WindowTitleOpen
lea.l 4*8(sp),sp
Wopen共通:
*KH 'WindowID = ',d0
move.l #Eattr,d1
move.l _WinNumber(pc),d2
bne @f
bset #Einterval,d1 * ウィンドウ#0 のみ interval event 起きる
@@:
movem.l d0/d1,-(sp)
bsr _WindowSetEventAttr
addq.l #8,sp
bra return_WinNumber
WindowClose:
move.l par1+6(sp),d0 * WindowNumber
lea.l _bwp,a0
lsl.w #2,d0
move.l (a0,d0.w),d1
beq return_minus
clr.l (a0,d0.w) * NULL
move.l d1,-(sp)
bsr _WindowClose
addq.l #4,sp
bra return_zero
WindowPop:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l d0,-(sp)
bsr _WindowPop
addq.l #4,sp
bra return_zero
WindowPush:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l d0,-(sp)
bsr _WindowPush
addq.l #4,sp
bra return_zero
WindowRedraw:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l d0,-(sp)
bsr _WindowRedraw
addq.l #4,sp
bra return_zero
WindowMove:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par3+6+0(sp),-(sp)
move.l par2+6+4(sp),-(sp)
move.l d0,-(sp)
bsr _WindowRedraw
lea.l 4*3(sp),sp
bra return_zero
WindowResize:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par5+6+0(sp),-(sp)
move.l par4+6+4(sp),-(sp)
move.l par3+6+8(sp),-(sp)
move.l par2+6+12(sp),-(sp)
move.l d0,-(sp)
bsr _WindowRedraw
lea.l 4*5(sp),sp
bra return_zero
WindowGetPosition:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par3+6+0(sp),-(sp) * xp
move.l par2+6+4(sp),-(sp) * yp
move.l d0,-(sp)
bsr _WindowGetPosition
lea.l 4*3(sp),sp
bra return_zero
WindowGetSize:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par3+6+0(sp),-(sp) * hp
move.l par2+6+4(sp),-(sp) * vp
move.l d0,-(sp)
bsr _WindowGetSize
lea.l 4*3(sp),sp
bra return_zero
WindowScrollOpen:
bra return_zero
*-------------------
WindowLoadExec:
movea.l par1+6(sp),a0
movea.l par2+6(sp),a1
tst.w par2(sp)
bge @f
lea.l use_null(pc),a1
@@:
suba.l a2,a2 * 親の環境
bsr win_check
beq win_exec
lea.l _ConsoleChar(pc),a3
tst.w par3(sp)
bmi @f
move.l par3+6(sp),d0
beq run実行
cmpi.l #3,d0
bcc irregular_param
lsl.w #2,d0
movea.l win_char(pc,d0.w),a3
bra @f
win_char:
.dc.l 0 * run
.dc.l _ConsoleChar * Console
.dc.l dummy_char * dummy(出力無し)
win_exec:
suba.l a3,a3
@@:
movem.l a0-a3,-(sp)
bsr _WindowLoadExec
lea.l 16(sp),sp
bra return_d0
run実行:
suba.l a3,a3
movem.l a0-a3,-(sp)
bsr _WindowScreenQuit
bsr _WindowLoadExec
bsr _WindowScreenInit
lea.l 16(sp),sp
bra return_d0
win_check:
movea.l a0,a4
@@:
tst.b (a4)+
bne @b
subq.l #5,a4 * .win0^
lea.l _win(pc),a5
moveq #3,d1
@@:
moveq #$20,d0
or.b (a4)+,d0
cmp.b (a5)+,d0
dbne d1,@b
wc_rts:
dummy_char:
rts
_win:
.dc.b '.win'
.even
UserSendExec:
movea.l par1+6(sp),a0
movea.l par2+6(sp),a1
tst.w par2(sp)
bge @f
lea.l use_null(pc),a1
@@:
movea.l par3+6(sp),a2
tst.w par3(sp)
bge @f
lea.l use_null(pc),a2
@@:
movem.l a0-a2,-(sp)
bsr _UserSendExec
lea.l 12(sp),sp
bra return_d0
use_null:
.dc.b 0
.even
*-------------------
PopUpMenu:
move.l par1+6(sp),d1 * x
move.l par2+6(sp),d2 * y
move.l par3+6(sp),a1 * item
addq.l #6,a1
moveq #0,d6
moveq #0,d7
movem.w (a1)+,d6/d7 * size/num of item
addq.l #1,d7
tst.w par4(sp)
bge @f
move.l d7,d4
bra 1f
@@:
move.l par4+6(sp),d4
ble irregular_param
cmp.l d7,d4
bhi irregular_param
1:
moveq #12,d5
tst.w par5(sp)
bmi @f
move.l par5+6(sp),d5
@@:
move.l sp,d7 * 保存
move.l d4,d0
lsl.l #2,d0
suba.l d0,sp
movea.l sp,a0
move.l d4,d0
subq.w #1,d0
@@:
move.l a1,(a0)+
adda.l d6,a1
dbra d0,@b
move.l sp,d3
movem.l d1-d5,-(sp)
bsr _PopUpMenu
movea.l d7,sp * 復帰
bra return_d0
*-----------------
IconEnt:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par2+6(sp),d1 * icon title
moveq #9,d2
tst.w par3(sp)
bmi ie1
move.l par3+6(sp),d2 * attribute of title
ie1:
moveq #16,d3
tst.w par4(sp)
bmi ie2
move.l par4+6(sp),d3 * font size of title
ie2:
movem.l d0-d3,-(sp)
bsr _IconEnt
lea.l 4*4(sp),sp
bra return_zero
*-----------------
WindowMoveOperation:
move.l func参照sysvar,d0 * info_?? の先頭
beq GetSendはE関数内で
move.l d0,-(sp)
move.l _WinID(pc),-(sp)
bsr _WindowMoveOperation
addq.l #8,sp
bra return_zero
WindowResizeOperation:
move.l func参照sysvar,d0 * info_?? の先頭
beq GetSendはE関数内で
move.l d0,-(sp)
move.l _WinID(pc),-(sp)
bsr _WindowResizeOperation
addq.l #8,sp
bra return_zero
*-----------------
SendUserString:
move.l par1+6(sp),-(sp)
pea.l UserString.w
bra senduser共通
SendUserSheet:
lea.l par1+6(sp),a0
bsr make_sheet_a1
bmi 配列小さ過ぎ
move.l a1,-(sp)
pea.l UserSheet.w
bra senduser共通
SendUserGraphic:
move.l par1+6(sp),d1 * h
move.l par2+6(sp),d2 * v
move.l par3+6(sp),a1 * graph
moveq #0,d3
move.w graph(pc),d3 * color mode
addq.l #6,a1
movem.w (a1)+,d6/d7 * 項サイズ/添え字最大
addq.w #1,d7
bcc 1f
moveq #0,d7 * 添え字数=65535 の時は
move.w d6,d7
swap d7 * 特別に $10000 倍
bra @f
1:
mulu.w d6,d7 * 配列 byte 数
@@:
move.l a1,d4 * &graph
move.l 8+graph(pc),d5 * &palet
lea.l _Ugraph(pc),a0
movem.l d1-d5,(a0)
addq.w #1,d1
addq.w #1,d2
mulu.w d1,d2
moveq.l #WindowAttrGraphic65536,d1
cmp.w d4,d1
bne @f
add.l d2,d2 * 65536 mode はワード単位
@@:
cmp.l d2,d7
bcs 配列小さ過ぎ
move.l a0,-(sp)
pea.l UserGraphic.w
*bra senduser共通
senduser共通:
* pea.l global_info(pc)
move.l func参照sysvar,d0
beq GetSendはE関数内で
move.l d0,-(sp)
move.l _WinID(pc),-(sp)
bsr _UserSendOperation
lea.l 16(sp),sp
bra return_zero
_Ugraph:
.dc.l 0 * h
.dc.l 0 * v
.dc.l 0 * color
.dc.l 0 * &graphic
.dc.l 0 * &palet
get_comdata_buffer:
move.l func参照sysvar,d0
beq @f
movea.l d0,a0
movem.l 15*4(a0),d0/a0 * ComData & Buffer
rts
@@:
moveq #-1,d0
rts
GetUserString:
bsr get_comdata_buffer
* KH ' ComData = ',d0
tst.l d0
bmi GetSendはE関数内で
subq.l #UserStrings,d0
bhi 転送データ違う
bne @f
movea.l (a0),a0
@@:
movea.l par1+6(sp),a1
move.w #$ff,d0
@@:
move.b (a0)+,(a1)+
dbeq d0,@b
clr.b (a1)
bra return_zero
GetUserSheet:
bsr get_comdata_buffer
tst.l d0
bmi GetSendはE関数内で
subq.l #UserSheet,d0
bne 転送データ違う
movea.l par1+6(sp),a1 * &h
move.l (a0)+,(a1)
movea.l par2+6(sp),a1 * &v
move.l (a0)+,d3
move.l d3,(a1)
move.l (a0)+,d2 * hsize
mulu.w d3,d2 * sheet size (word)
movea.l par3+6(sp),a1
bsr get_sheet_sub
bcs 配列小さ過ぎ
movea.l par4+6(sp),a1
bsr get_sheet_sub
bcs 配列小さ過ぎ
bra return_zero
get_sheet_sub:
addq.l #6,a1
movem.w (a1)+,d0/d1
addq.w #1,d1
mulu.w d1,d0 * 配列 byte 数
lsr.l #1,d0
cmp.l d2,d0
bcs 9f
movea.l (a0)+,a2
move.l d2,d0
@@:
move.w (a2)+,(a1)+
subq.l #1,d0
bgt @b
9:
rts
GetUserGraphic:
bsr get_comdata_buffer
tst.l d0
bmi GetSendはE関数内で
subq.l #UserGraphic,d0
bne 転送データ違う
movea.l par1+6(sp),a1 * &h
move.l (a0)+,d2
move.l d2,(a1)
movea.l par2+6(sp),a1 * &v
move.l (a0)+,d3
move.l d3,(a1)
mulu.w d3,d2 * graphic size
move.l (a0)+,d3 * Attr
movea.l (a0)+,a2 * graph
cmpi.w #WindowAttrGraphic65536,d3
bne 1f
add.l d2,d2 * graphic size (byte)
suba.l a1,a1
bra 2f
1:
movea.l (a0)+,a1 * palet
move.l a1,d0
ble 2f
lea.l gra_palet,a0
moveq #16/4-1,d1
cmpi.w #WindowAttrGraphic16,d3
beq @f
moveq #256/4-1,d1
@@:
move.l (a1)+,(a0)+
dbra d1,@b
lea.l gra_palet,a1
2:
movea.l par3+6(sp),a0
addq.l #6,a0
movem.w (a0)+,d6/d7
addq.w #1,d7
bcc 1f * H9/3/5
moveq #0,d7 * 添え字数=65535 の時は
move.w d6,d7
swap d7 * 特別に $10000 倍
bra 2f
1:
mulu.w d6,d7 * 配列 byte 数
2:
cmp.l d2,d7
bcs 配列小さ過ぎ
@@:
move.b (a2)+,(a0)+
subq.l #1,d2
bgt @b
move.l a1,d0
ble return_zero
move.l a1,-(sp) * palet
pea.l _DefGraphicSleep(pc)
move.l d3,-(sp) * WindowSetAttr兼
pea.l graph(pc)
bsr _DefGraphicInit
lea.l 16(sp),sp
bra return_zero
*-----------------
DrawClear:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
lea.l DrawBuf(pc),a0
moveq.l #DClear,d1
move.l par2+6(sp),d2 * color
movem.l d1/d2,(a0)
bra draw共通
DrawPut:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
moveq #DPut,d1
move.l par2+6(sp),d2 * x
move.l par3+6(sp),d3 * y
lea.l par4+6(sp),a0
bsr make_sheet_a1
bmi 配列小さ過ぎ
lea.l DrawBuf(pc),a0
movem.l d1/d2/d3/a1,(a0)
bra draw共通
sheet_sub:
addq.l #8,a2
cmp.w (a2)+,d6
bhi @f
move.l a2,(a1)+
rts
@@:
moveq #-1,d0
rts
make_sheet_a1:
movem.l d4-d6/a2,-(sp)
move.l (a0),d4 * x_size
moveq #15,d6
add.l d4,d6
lsr.l #4,d6 * hword
move.l 10(a0),d5 * v
lea.l SheetBuf(pc),a1
movem.l d4/d5/d6,(a1)
lea.l 12(a1),a1
mulu.w d5,d6
lsl.w #1,d6
subq.w #1,d6 * 必要バイト数
movea.l 20(a0),a2 * sheet1
bsr sheet_sub
bmi @f
movea.l 30(a0),a2 * sheet2
bsr sheet_sub
bmi @f
lea.l SheetBuf(pc),a1
@@:
movem.l (sp)+,d4-d6/a2 * flag 変化せず
rts
SheetBuf:
.ds.l 5
DrawLine:
moveq #OptionLine,d1
bra DrawLine共通
DrawBox:
moveq #OptionBox,d1
bra DrawLine共通
DrawFill:
moveq #OptionFill,d1
bra DrawLine共通
DrawShadow:
moveq #OptionShadow,d1
DrawLine共通:
moveq #DLine,d2
Line共通:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
lea.l DrawBuf(pc),a0
move.l d2,(a0)+
move.l par2+6(sp),(a0)+ * x1
move.l par3+6(sp),(a0)+ * y1
move.l par4+6(sp),(a0)+ * x2
move.l par5+6(sp),(a0)+ * y2
move.l par6+6(sp),(a0)+ * color
move.l d1,(a0)
lea.l DrawBuf(pc),a0
bra draw共通
DrawSymbol:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
pea.l 1.w
lea.l DrawBuf(pc),a0
move.l a0,-(sp)
move.l #DSymbol,(a0)+
move.l par2+6+8(sp),(a0)+ * x
move.l par3+6+8(sp),(a0)+ * y
move.l par4+6+8(sp),(a0)+ * str
moveq #9,d1 * default attr.
tst.w par5+0+8(sp)
bmi @f
move.l par5+6+8(sp),d1
@@: move.l d1,(a0)+ * attr
moveq #16,d1
tst.w par6+0+8(sp)
bmi @f
move.l par6+6+8(sp),d1
@@: move.l d1,(a0)+ * font
move.l d0,-(sp)
bsr _WindowDraw
lea.l 4*3(sp),sp
bra return_zero
DrawBuf:
.ds.b 28
*-------------------
WindowAttrGraphic16 equ 4 * 16色モード
WindowAttrGraphic256 equ 8 * 256色モード
WindowAttrGraphic65536 equ 12 * 65536色モード
GraphicInit:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
move.l d0,d3
beq return_minus
move.l par2+6(sp),d2
moveq.l #WindowAttrGraphic16,d1
cmpi.l #16,d2
beq @f
moveq.l #WindowAttrGraphic256,d1
cmpi.l #256,d2
beq @f
moveq.l #WindowAttrGraphic65536,d1
cmpi.l #65536,d2
bne irregular_param
@@:
moveq #-1,d0
movea.l d0,a1
tst.w par3(sp)
bmi @f
movea.l par3+6(sp),a0
lea.l gra_palet,a1
addq.l #8,a0
move.w (a0)+,d0
cmpi.w #$0100,d0
bcs 1f
move.w #$00ff,d0
1:
addq.l #2,a0
move.w (a0)+,(a1)+
dbra d0,1b
lea.l gra_palet,a1
@@:
move.l a1,-(sp)
pea.l _DefGraphicSleep(pc)
move.l d1,-(sp) * WindowSetAttr兼
pea.l graph(pc)
bsr _DefGraphicInit
bsr _DefGraphicPalet
move.l d3,(sp)
bsr _WindowSetAttr
lea.l 16(sp),sp
* moveq #0,d0 * 256色モードでパレットが設定されないバグを探してます
* move.w graph(pc),d0
* KH ' graph.mode = ',d0
bra return_zero
graphic_repalet::
lea.l graph(pc),a1
tst.w (a1) * mode
beq @f
move.l a1,-(sp)
bsr _DefGraphicPalet
addq.l #4,sp
@@:
rts
graphic_move::
moveq #0,d0
lea.l graph(pc),a1
tst.w (a1) * mode
beq @f
movem.l 4(sp),d0/a0 * WID/info
movem.l d0/a0,-(sp)
move.l a1,-(sp)
bsr _DefGraphicEnt
lea.l 12(sp),sp
@@:
rts
graph:
.dc.w 0 * mode
.dc.w 0 * sleep
.dc.l 0 * *f_sleep()
.dc.l 0 * *palet
.bss
gra_palet:
.ds.w $100
.text
DrawGraphicClear:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
moveq.l #DGraphicClear,d1
move.l par2+6(sp),d2 * color
lea.l DrawBuf(pc),a0
movem.l d1/d2,(a0)
bra draw共通
DrawGraphicLine:
moveq #OptionLine,d1
bra @f
DrawGraphicBox:
moveq #OptionBox,d1
bra @f
DrawGraphicFill:
moveq #OptionFill,d1
bra @f
DrawGraphicShadow:
moveq #OptionShadow,d1
@@:
moveq #DGraphicLine,d2
bra Line共通
DrawGraphicPut:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par2+6(sp),d2 * x1
move.l par3+6(sp),d3 * y1
move.l par4+6(sp),d4 * x2
move.l par5+6(sp),d5 * y2
move.l par6+6(sp),a1 * graph
addq.l #6,a1
move.w (a1)+,d6
move.w (a1)+,d7
addq.w #1,d7
bcc 1f * H9/3/7
moveq #0,d7 * 添え字数=65535 の時は
move.w d6,d7
swap d7 * 特別に $10000 倍
bra 2f
1:
mulu.w d6,d7 * 配列 byte 数
2:
tst.w par7(sp)
bmi @f
move.l par7+6(sp),d6
bclr.l #0,d6
bne irregular_param
adda.l d6,a1
sub.l d6,d7
bcs 配列小さ過ぎ
@@:
lea.l DrawBuf(pc),a0
moveq.l #DGraphicPut,d1
movem.l d1-d5/a1,(a0)
sub.w d2,d4
sub.w d3,d5
addq.w #1,d4
addq.w #1,d5
mulu.w d4,d5
moveq.l #WindowAttrGraphic65536,d1
cmp.w graph(pc),d1
bne @f
add.l d5,d5 * 65536 mode はワード単位
@@:
cmp.l d5,d7
bcs 配列小さ過ぎ
bra draw共通
*-------------------
TrumpOpen:
bsr _TrumpOpen
tst.l d0
bgt return_d0
bra cardopenerr
JpaiOpen:
bsr _JpaiOpen
tst.l d0
bgt return_d0
cardopenerr:
lea.l _cardopenerrmes(pc),a1
moveq #10,d0
bra err共通
_cardopenerrmes:
.dc.b 'カードがオープン出来ません。dbserv.win は組み込んでます?',0
.even
TrumpClose:
bsr _TrumpClose
bra return_d0
JpaiClose:
bsr _JpaiClose
bra return_d0
DrawCard:
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
move.l par2+6(sp),d2 * x
move.l par3+6(sp),d3 * y
move.l par4+6(sp),d4 * card#
movea.l par5+6(sp),a2 * card種類
movea.l (a2),a2
asl.l #2,d4
move.l 4(a2,d4.l),d4
add.l d4,d4
adda.l d4,a2
move.l d2,d4
move.l d3,d5
add.w (a2)+,d4 * xsize
add.w (a2)+,d5 * ysize
subq.w #1,d4
subq.w #1,d5
lea.l DrawBuf(pc),a0
moveq.l #DGraphicPut,d1
movem.l d1-d5/a2,(a0)
bra draw共通
DrawMonoCard:
move.l par2+6(sp),d2 * x
move.l par3+6(sp),d3 * y
move.l par4+6(sp),d4 * card#
move.l par5+6(sp),d5 * card種類
movem.l d2-d5,-(sp)
pea.l DrawBuf(pc)
bsr _CardDrawSetMono
lea.l 4*5(sp),sp
move.l par1+6(sp),d0 * WindowNumber
bsr get_WindowID
tst.l d0
beq return_minus
lea.l DrawBuf(pc),a0
bra draw共通
*-------------------
draw共通:
pea.l 1.w * DrawBuf の要素数
movem.l d0/a0,-(sp) * WindowID / DrawBuf
bsr _WindowDraw
lea.l 4*3(sp),sp
bra return_zero
*-------------------
IntervalTime:
IOCS _ONTIME
lsl.w #8,d1
swap.w d1
or.l d1,d0
bra return_d0
*-------------------
return_zero:
moveq.l #0,d0
lea.l fac(pc),a0
move.l d0,6(a0)
rts
return_WinNumber:
move.l _WinNumber(pc),d0
bra return_d0
file_end:
tst.l d0
bge return_d0
return_minus:
moveq #-1,d0
return_d0:
lea.l fac(pc),a0
move.l d0,6(a0)
moveq.l #0,d0
rts
*-----------------------------
.even
fac:
.dc.w 0
.dc.l 0
.dc.l 0
*-----------------------------
* 外部関数エラー
GetSendはE関数内で:
lea.l _GetSendはE関数内で(pc),a1
moveq #10,d0
bra 1f
転送データ違う:
lea.l _転送データ違う(pc),a1
moveq #9,d0
bra 1f
配列小さ過ぎ:
lea.l _配列小さ過ぎ(pc),a1
moveq #8,d0
bra 1f
irregular_param:
lea.l _irregular_param(pc),a1
moveq #4,d0
bra 1f
無効な要素数:
lea.l _無効な要素数(pc),a1
moveq #6,d0
1:
err共通:
lea.l fac(pc),a0
moveq #-1,d1 * error off の時の返り値
move.l d1,6(a0)
rts
_転送データ違う:
.dc.b '転送されたデータの型が違いますです',0
_配列小さ過ぎ:
.dc.b 'Sheet/Graphic 用の配列小さ過ぎません?',0
_irregular_param:
.dc.b '引き数の範囲が不正です',0
_無効な要素数:
.dc.b '無効な要素数を指定しました',0
_GetSendはE関数内で:
.dc.b 'Get~()/SendUser() はイベント関数内でなければ実行出来ませんのです',0
.even
.end